Image lens distortion correcting method

ABSTRACT

There is disclosed an image lens distortion correcting method comprising: an image printing step (A) for printing an arbitrary image I 1  in a computer; an image pickup step (B) for photographing the printed image I 1  with a camera having a lens distortion and obtaining a photographed image I 2  in the computer; a parameter estimating step (C) for obtaining a parameter θ such that the image I 1  is artificially distorted with the parameter θ and an obtained distorted image I 1   ud  equals with the photographed image I 2 ; and an image correcting step (D) for using the obtained parameter θ to correct the image photographed by the camera. Thereby, (1) no correspondence point needs to be given, (2) any special tool or object is not used, and (3) all points on the image are used, so that an internal parameter can automatically be obtained with high precision, and an image lens distortion can be corrected with high precision.

BACKGROUND OF THE INVENTION

[0001] 1. Field of the Invention

[0002] The present invention relates to a correcting method of lens distortion of an image.

[0003] 2. Description of Related Art

[0004] An image taken by a video camera or a digital camera causes distortion (distortion aberration) depending upon a camera lens. The distortion aberration is generally extreme with a wide angle, increases toward a periphery of the image, and increases to 3% or more particularly with a zoom lens. Moreover, since the image is deformed in a so-called barrel or bobbin shape, this distortion aberration disadvantageously adversely affects estimation in computer vision, measurement using the image, and the like.

[0005] Parameters such as a distortion coefficient for determining a camera lens distortion are called a camera internal parameter, and cameral calibration means that the camera internal parameter is obtained. When the camera internal parameter can be obtained through camera calibration, the image lens distortion can be corrected by an image processing using the internal parameter.

[0006] A conventional camera calibrating method is disclosed in many research papers.

[0007] In the aforementioned conventional method, a relation between a certain point in a three-dimensional space and a point signal to the certain point (correspondence point) in the image is derived, and the internal parameter is estimated. There are two methods of obtaining the correspondence point as follows:

[0008] (1) A person designates the correspondence point with a mouse or the like.

[0009] (2) A grid intersection point, a polygon or polyhedron apex, or another characteristic point is automatically detected.

[0010] Since either one of these methods includes a measurement error, a large number of correspondence points have to be given in order to inhibit an error influence. That is, the more the number of correspondence points is, the more precise the obtained internal parameter becomes. Therefore, correspondence of an enormous number of (several tens to several hundreds) points has to be designated.

[0011] Moreover, these methods have the following problems.

[0012] In the method (1) in which the person designates the correspondence point with the mouse or the like, the error is large, operation is monotonous, and much labor is necessary. Furthermore, fatigue increases the error during designation.

[0013] In the method (2) (characteristic point detecting method) of automatically detecting the characteristic point by the image processing, the number of points detectable by the processing is limited. For example, when the grid intersection point is detected, the number of intersection points is only 88 in total even with 8 longitudinal lines and 11 lateral lines. It is said that at least 200 points or more are necessary for obtaining the parameter with good precision, and it is necessary to prepare the corresponding grid, polyhedron, and the like.

SUMMARY OF THE INVENTION

[0014] The present invention has been developed to solve the aforementioned various problems. That is, an object of the present invention is to provide an image lens distortion correcting method in which (1) no correspondence point needs to be given, (2) any special tool or object is not used, and (3) all points on an image are used, so that an internal parameter can automatically be obtained with high precision, and an image lens distortion can be corrected with high precision.

[0015] According to the present invention, there is provided an image lens distortion correcting method comprising: an image printing step (A) for printing an arbitrary image I₁ in a computer; an image pickup step (B) for taking the printed image I₁ with a camera having a lens distortion and obtaining a photographed image I₂ in the computer; a parameter estimating step (C) for obtaining a parameter θ such that the image I₁ is artificially distorted with the parameter θ and an obtained distorted image I₁ ^(ud) agrees with the photographed image I₂; and an image correcting step (D) for using the obtained parameter θ to correct the image taken by the camera.

[0016] According to the aforementioned method of the present invention, first the arbitrary image I₁ (Computer graphics, a picture extracted with a scanner, or an image taken by a digital camera) is prepared as a calibration pattern in the computer. Subsequently, the image I₁ is printed with a printer having no distortion. The printed image I₁ is taken by a camera to be corrected, and the distorted photographed image I₂ is obtained. When the certain internal parameter θ is given, the image I₁ can artificially be distorted. When the artificially distorted image I₁ ^(ud) is compared with the distorted image I₂ and the images accurately equal with each other, the given parameter θ is desirable, and the obtained parameter θ can be used to correct the camera lens distortion.

[0017] According to a preferred embodiment of the present invention, the parameter θ includes a position correction parameter θ^(u) for correcting a position, and a distortion correction parameter θ^(d) for correcting the distortion.

[0018] The position correction parameter θ^(u) is a parameter for conversion to an image I₁ ^(u) with the corrected position from the image I₁. The conversion parameter is obtained in a least-squares method such that a difference r=I₁(p)−I₁ ^(u)(p+u) between a luminance value I₁(p) of a point p in the image I₁ and a luminance value I₁ ^(u)(p+u) of a point p+u in the image I₁ ^(u) corresponding to the point p is minimized entirely on the image. The obtained parameter is used as the position correction parameter θ^(u).

[0019] Moreover, the distortion correction parameter θ^(d) is a parameter for conversion to the image I_(i) ^(u) from the distorted image I₁ ^(ud). The conversion parameter is obtained in the least-squares method such that a difference r=I₂(p)−I₁ ^(u)(f(p)) between a luminance value I₂(p) of the point p in the image I₂ and a luminance value I₁ ^(u)(f(p)) of a point f(p) in the image I₁ ^(u) corresponding to the point p is minimized entirely on the image. The obtained parameter is used as the distortion correction parameter θ^(d).

[0020] Furthermore, in the image correcting step (D), the obtained distortion correction parameter θ^(d) is used to correct the image taken by the camera.

[0021] That is, as shown in FIG. 1, a position in the photographed image I₂ in which the original image I₁ is projected is not known. Therefore, two stages are performed in order to obtain the distorted image I₁ ^(ud). That is, first the position corrected image I₁ ^(u) is obtained from the image I₁, subsequently the image I₁ ^(u) is distorted and the distorted image I₁ ^(ud) is obtained.

First Stage

[0022] First, the parameter θ^(u) for conversion to the image I₁ ^(u) from the image I₁ is obtained. This does not include any internal parameter. The point in I₁ ^(u) corresponding to the point p in the image I₁ deviates by u and is represented by p+u. Here, u changes with p and θ^(u). When the image I₁ exactly equals with the photographed image I₂, the luminance value I₁ (p) in p has to be equal to the luminance value I₂(p+u) in p+u. That is, the luminance difference r=I₁(p)−I₂(p+u) in each point has to be 0. An evaluation function Σr² is obtained by summing squared differences for all the points, and the parameter θ^(U) is automatically obtained by repeating calculations such that the evaluation function is minimized.

Second Stage

[0023] Subsequently, the parameter θ^(d) for conversion to the image I₁ ^(u) from the distorted image I¹ ^(ud) is obtained. This is the internal parameter such as a distortion coefficient. This stage is similar to the first stage, but instead of the conversion to the distorted image I₁ ^(ud) from the image I₁ ^(u), a reverse conversion to the image I₁ ^(u) from the distorted image I₁ ^(ud) is considered.

[0024] The point in image I₁ ^(u) corresponding to the point p in the photographed image I₂ is represented by f(p). Here, f( ) changes with p and θ^(d).

[0025] When the photographed image I₂ exactly equals with the image I₁ ^(u), the luminance value I₂(P) in p has to be equal to the luminance value I₁ ^(u)(f(p)) in f(p). That is, the luminance difference r=I₂(p)−I₁ ^(u)(f(p)) in each point has to be 0. The evaluation function Σr² is obtained by summing squared differences for all the points, and the parameter θ^(u) is automatically obtained by repeating calculations such that the evaluation function is minimized.

Correction

[0026] The internal parameter θ^(d) used for obtaining the distorted image I₁ ^(ud) from the image I₁ can be used to conversely obtain I₁ from I₁ ^(ud). That is, a processing for correcting the applied distortion can be performed.

[0027] When the image I₂ taken by the camera is subjected to the same processing as described above, the image with the corrected distortion can be obtained.

[0028] In the parameter estimating step (C), it is preferable to alternately repeatedly use the position correction parameter θ^(u) and the distortion correction parameter θ^(d) and obtain the parameter θ.

[0029] Moreover, the parameter θ is a parameter for conversion to the image I₁ ^(ud) from the image I₁. The conversion parameter is obtained in the least-squares method such that a difference r=I₁(p)−I₂(d(p+u(p)) between a luminance value I₁(p) of the point p in the image I₁ and a luminance value I₂(d(p+u(p)) of a point d(p+u(p)) in the image I₂ corresponding to the point p is minimized entirely on the image. The obtained parameter is used as the parameter θ.

[0030] According to the method, the parameter θ can be estimated by a single step.

[0031] Other objects and advantageous characteristics of the present invention will be apparent from the following description with reference to the accompanying drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

[0032]FIG. 1 is a diagram schematically showing a method of the present invention.

[0033]FIG. 2 shows a halftone image displayed on a display in a calibration pattern used in an embodiment.

[0034]FIG. 3 shows the halftone image displayed on the display before and after correction according to the method of the present invention.

[0035]FIG. 4 shows another halftone image displayed on the display before and after the correction according to the method of the present invention.

[0036]FIG. 5 is a schematic diagram of a method of repeating two steps.

[0037]FIG. 6 is a schematic diagram of an estimating method with one step.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0038] A preferred embodiment of the present invention will be described hereinafter with reference to the drawings. Additionally, common portions in the respective drawings are denoted with the same reference numerals, and redundant description is omitted.

[0039] Camera calibration and lens distortion correction are important processes in computer vision. In recent years, self calibration has been studied. In many researches, to facilitate the calibration, distortion is not considered and respective problems are formulated. Therefore, it is necessary to calibrate an internal parameter of a camera beforehand.

[0040] Some pieces of calibration software have been utilized via Internet (e.g., Tsai's method). However, in such ordinary method, it is necessary to obtain a correspondence between a point on an image and a point on a known three-dimensional coordinate (a plane, or a cube, a model or another structure), and subsequently point conversion is estimated.

[0041] In this method, the point correspondence must manually be estimated. Therefore, an error is generated in a manual operation and this lacks in reliability. Additionally, the method requires much time and endurance. Therefore, it is almost impossible to measure a change of a distortion parameter during zoom-in/zoom-out of the camera.

[0042] One of alternative methods is detection of a marker. This can be performed by a template matching method to an extend of sub-pixels. However, there is another problem that the marker on the image corresponds to a coordinate in a known space. To improve estimation precision, it is necessary to increase the number of markers, and this problem cannot be ignored. Even if this problem can be avoided, the number of points for the correspondence is still limited.

[0043] In the present invention, there is proposed a new correcting method for correcting an image distortion by a lens zoom operation. In the proposed method, the correspondence is set, and the estimation is expected to be more precise than the marker detection. This is because all points of the image are used in the method, instead of using some points of the marker. This method is based on an image registration (superposition) method applied to a motion analysis region, and includes the following three steps, that is, affine transformation, plane projection transformation, and lens distortion restoration.

Three Estimating Steps by Registration

[0044] A basic idea is that a correspondence between points is necessary for calibration, and registration can satisfy this requirement. In the proposed method, an ideal calibration pattern is associated with a distorted image obtained by taking the printed pattern with the camera. Since a size of the pattern printed on a sheet can easily be measured, a three-dimensional coordinate of each pixel in the pattern can easily be determined. As other characteristics of the method, any image can be used as the calibration pattern. Moreover, once the parameter is estimated, the parameter can be used as long as the lens zoom operation is unchanged.

[0045] The method includes the following three steps. In a first step, the pattern is coarsely transformed into an image represented by an affine parameter and translatory parameter. In a second step, an accurate parameter of plane transformation under through-view projection is estimated by a nonlinear optimizing method. In a third step, a distortion parameter is estimated in order to minimize a residual which remains after application of the second step.

Affine Transformation by detected Marker

[0046] First, a pattern image I₁ is prepared. The pattern image has three-color (red, green, blue) markers having coordinates m_(r), m_(g), m_(b) in respective corners. Subsequently, the pattern image I₁ is printed in color in order to facilitate detection of the marker.

[0047] Therefore, an image I₂ of the printed pattern I₁ is taken by a camera to be calibrated. Coordinates of markers m_(r)′, m_(g)′, m_(b)′ in the image I₂ are detected by thresholding or template matching.

[0048] Here, a parameter for transforming the pattern image I₁ to the pattern projected in the image I₂ is calculated. The transformation is represented by six affine parameters θ^(α)=(θ^(α) ₁, . . . θ^(α) ₆)^(T).

[0049] While p=(x, y)^(T) is set as one point on the pattern I₁, p+a(p;θ^(α)) is set as one point on I₂ corresponding to p. Here, equation (1) of [Equation 1] is established. Subsequently, a linear equation of equation (2) is solved, and parameter θ^(α) is obtained. $\begin{matrix} {\left\lbrack {E\quad q\quad u\quad a\quad t\quad i\quad o\quad n{\quad \quad}1} \right\rbrack {{a\left( {p;\theta^{a}} \right)} = {\begin{pmatrix} x & y & 0 & 0 & 1 & 0 \\ 0 & 0 & x & y & 0 & 1 \end{pmatrix}\theta^{a}}}} & (1) \end{matrix}$

m′ _(i) =m _(i)+α(m _(i); θ^(α),) i=r, g, b   (2)

Image Registration; Perspective Fitting

[0050] In the first step described above, only three correspondence points are employed with respect to the affine transformation. Subsequently, plane projection transformation is utilized, and accurate correspondence among individual points is set as image registration.

Model and Formulation

[0051] Here, a luminance residual between p_(i) in the image I₁ and p₁+u(p_(i);θ^(u)) in the image I₂ corresponding to p_(i) is minimized. Here, when the residual is defined as in equations (3), (4) of [Equation 2], a function to be minimized is obtained as in equation (5).

Equation 2

r _(ι) =I ₁(p _(i))−I₂(p _(ι) +u(p _(ι);θ^(u)))   (3)

[0052] $\begin{matrix} \begin{matrix} {{u\left( {p;\theta^{u}} \right)} = \quad {\begin{pmatrix} x & y & 0 & 0 & 1 & 0 & x^{2} & {x\quad y} \\ 0 & 0 & x & y & 0 & 1 & {x\quad y} & y^{2} \end{pmatrix}\theta^{u}}} \\ {= \quad {M^{u}\theta^{u}}} \end{matrix} & (4) \\ \begin{matrix} {\min\limits_{\theta^{\quad u}}{\sum\limits_{i}{\rho \left( r_{i} \right)}_{1}}} & {{\rho \left( r_{i} \right)} = r_{i}^{2}} \end{matrix} & (5) \end{matrix}$

[0053] Here, u( ) denotes displacement of a point on a plane, when a point of view is changed from a certain point to another point under perspective projection. The displacement is a motion model on the plane under the perspective projection, and is represented by eight parameters θ^(u)=(θ₁ ^(u), . . . , θ₈ ^(u))^(T) frequently used in motion analysis.

Minimizing Method

[0054] The function (5) is minimized by Gauss-Newton method as a famous nonlinear optimization technique and the parameter θ^(u) is estimated. The parameter is updated by equation (6) of [Equation 3].

[0055] As an initial value of first six elements of the parameter θ^(u), the affine parameter θ^(α) obtained in the first stage is used. Last two elements of the parameter θ^(u) are initialized/set to 0.

[0056] A direction δθ^(u) in which the function (5) is decreased is calculated by equations (7) to (10).

Equation 3

θ^(u)←θ^(u)+δθ^(u)  (6)

δθ^(u)=−(J{tilde over (D)}J^(T))⁻¹J{tilde over (D)}r   (7)

[0057] $\begin{matrix} {J = {{J\left( \theta^{u} \right)} = {\frac{\partial r}{\partial\theta^{u}} = \left\lbrack \frac{\partial r_{i}}{\partial\theta_{j}^{u}} \right\rbrack}}} & (8) \\ {\overset{\_}{D} = {d\quad i\quad a\quad {g\left\lbrack \frac{\overset{.}{\rho}\left( r_{i} \right)}{r_{i}} \right\rbrack}}} & (9) \\ {{\overset{.}{\rho}\left( r_{i} \right)} = \left. \frac{\partial{\rho (r)}}{\partial r} \right|_{r = r_{i}}} & (10) \end{matrix}$

[0058] This is the same as formulation of the least-squares method. That is, the equation is the same as a simultaneous linear equation represented by equation (11) of [Equation 4] for k=1, . . . , 8. A differentiating chained law is used to convert a partial derivation as represented by equation (12). The calculation of aft in the equation (6) is repeated until δθ^(u) converges. In each repetition, the parameter estimated in the previous repetition is used in calculation of u(p). When the repeated calculation stops, the estimated parameter is θ^(u)′,

Equation 4

[0059] $\begin{matrix} {{{\sum\limits_{l,i}{\frac{\overset{.}{\rho}\left( r_{i} \right)}{r_{i}}\frac{\partial r_{i}}{\partial\theta_{k}^{u}}\frac{\partial r_{i}}{\partial\theta_{l}^{u}}{\delta\theta}_{l}^{u}}} = {- {\sum\limits_{i}{\frac{\overset{.}{\rho}\left( r_{i} \right)}{r_{i}}r_{i}\frac{\partial r_{i}}{\partial\theta_{k}^{u}}}}}}{{{{for}\quad k} = 1},\ldots \quad,8.}} & (11) \\ {\frac{\partial r}{\partial\theta^{u}} = {{\frac{\partial u}{\partial\theta^{u}}\frac{\partial r}{\partial u}} = {{- M^{u\quad T}}{\nabla{I_{2}\left( {p + {u(p)}} \right)}}}}} & (12) \end{matrix}$

Image Registration; Distortion Fitting

[0060] In the previous step, except the influence by the lens distortion, the image registration between the pattern image and the distorted image pattern ends.

Distortion Model

[0061] A relation between a coordinate having no distortion is and coordinate having the distortion in a certain image is usually modeled by the following five camera internal parameters, that is, distortion parameters k₁ and k₂, image center coordinate (c, c_(y))^(T) and a ratio s_(x) of a pixel width to height. These parameters are set to θ^(d)=(k₁, k₂, c_(x), c_(y), s_(x))^(T).

[0062] The distortion is represented by a coordinate system having an origin in (c_(x), c_(y))^(T). On the other hand, the previously used coordinate system has an origin in an uppermost left corner. Therefore, another notation is introduced as follows.

[0063] That is, P_(u)=(x_(u), y_(u))^(T) and p_(d)=(x_(d), u_(d))^(T) are set as points in an image having no distortion and image having the distortion, respectively, and both images have an origin in the left upper corner of the image. Moreover, (ξ_(u), η_(n))^(T) and (ξ_(d), η_(d))^(T) are set as points in the image having no distortion and image having the distortion, respectively, in which respective origins are in the image center (c_(x), c_(y))^(T). These points can be represented by equations (13) to (15) of [Equation 5].

[0064] As described above, ξ_(u) is represented to be positive as the function of ξ_(d) but this does not apply to ξ_(d). In order to obtain ξ_(d) from ξ_(u), equation (16) is repeatedly solved.

Equation 5

(ξ_(u),η_(u))^(T)=(x _(u) ,y _(u))^(T)−(c _(x) , c _(y))^(T)  (13)

(ξ_(u),η_(d) ^(T)=(ξ_(u),η_(u))^(T)−(k ₁ R ² +k ₂ R ⁴)(ξ_(d), η_(d))^(T)  (14)

(x _(d) ,y _(d))^(T)=(s_(x)ξ_(d),η_(d))^(T)+(c_(x), c_(y))^(T)(15)

R={square root}{square root over (ξ_(d) ²+η_(d) ²)}

[0065] $\begin{matrix} {\left( {\xi_{d\quad k},\eta_{d\quad k}} \right)^{T} = \frac{\left( {\xi_{u},\eta_{u}} \right)^{T}}{1 + {\kappa_{1}R_{k - 1}^{2}} + {\kappa_{2}R_{k - 1}^{4}}}} & (16) \end{matrix}$

R_(k)={square root}{square root over (ξ_(dk) ²+η_(dk) ²)},

R₀={square root}{square root over (ξ_(u) ²+η_(u) ²)}

[0066] The aforementioned relation is used to obtain two functions between p_(U) and p_(d) for the coordinate system having the origin in the uppermost left corner as represented by equations (17) and (18) of [Equation 6]. Here, f and d are mutually inverse functions. However, since d corresponds to the equation (16), d is not a explicit function of p_(u).

[0067] In any case, the equations (17) and (18) can be used to represent transformation between two images. While I₁ ^(u) is the image of the pattern transformed by applying θ^(u)′ to I₁, I₁ ^(ud) is the image of the pattern transformed by applying θ^(d) to I₁ ^(u). That is, the relation is represented by equations (20) to (22). These relations are shown in FIG. 1.

Equation 6

P _(d) =d(p _(u);θ^(d))   (17)

[0068] $\begin{matrix} \begin{matrix} {p_{u} = \quad {f\left( {p_{d};\theta^{d}} \right)}} \\ {= \quad \begin{pmatrix} {{\frac{x_{d} - c_{r}}{s_{r}}\left( {1 + {\kappa_{1}R^{\prime 2}} + {\kappa_{2}R^{\prime 4}}} \right)} + c_{x}} \\ {{\left( {y_{d} - c_{y}} \right)\left( {1 + {\kappa_{1}R^{\prime 2}} + {\kappa_{2}R^{\prime 4}}} \right)} + c_{y}} \end{pmatrix}} \end{matrix} & (18) \\ {R^{\prime} = \quad \sqrt{\left( \frac{x_{d} - c_{r}}{s_{r}} \right)^{2} + \quad \left( {y_{d} - c_{y}} \right)^{2}}} & (19) \end{matrix}$

I _(i)(p)=I _(i) ^(u)(p+u(p;θ^(u)))   (20)

I ₁ ^(u)(p)=I₁ ^(ud)(d(p))   (21)

I _(i) ^(u)(f(p))=i ₁ ^(ud)(p)   (22)

Minimization by Reverse Registration

[0069] The transformation to the image I₁ ^(ud) from I₁ is represented by u and d. However, since d is not the explicit function, the parameter between I₁ and I₁ ^(ud) cannot directly be estimated by registration.

[0070] Here, reverse registration is considered. As shown in FIG. 1, the image I₂ is matched with I₁ ^(ud). That is, the residual of luminance between two images represented by equation (23) of [Equation 7] is minimized.

[0071] However, this equation can be represented by equation (24) using equation (22). Then, an estimating method is the same as that of the previous step. The minimization is performed on the function of equation (25) by the Gauss-Newton method.

[0072] Here, Ω={i;p_(i)∈I₂, ∃p∈I₁, f(p_(i))=p+u(p)} means that the minimization has to be applied to the point inside the region corresponding to the pattern I₁ among points in I₂.

Equation 7

r _(i) =I ₁ ^(ud)(p _(ι))−I ₂(p _(i))   (23)

r ₁ =I ₂(p _(ι))−I ₁ ^(u)(f(p _(ι);θ^(d))   (24)

[0073] $\begin{matrix} {{\min\limits_{\theta^{d}}{\sum\limits_{\Omega}{\rho \left( r_{i} \right)}}}{\Omega = \left\{ {{i;{p_{i}\varepsilon \quad I_{2}}},{\exists{p\quad \varepsilon \quad I_{1}}},{{f\left( p_{i} \right)} = {p + {u(p)}}}} \right\}}} & (25) \end{matrix}$

[0074] The simultaneous linear equation in which solution needs to be found has the same form as that of the equation (11), and is represented by equation (26) of [Equation 8]. The derivation in the equation (26) is represented by equation (27).

Equation 8

[0075] $\begin{matrix} {{\sum\limits_{l,\quad {i\quad {\varepsilon\Omega}}}{\frac{\overset{.}{\rho}\left( r_{i} \right)}{r_{i}}\frac{\partial r_{i}}{\partial\theta_{k}^{d}}\frac{\partial r_{i}}{\partial\theta_{l}^{d}}{\delta\theta}_{l}^{d}}} = {- {\sum\limits_{i\quad {\varepsilon\Omega}}{\frac{\overset{.}{\rho}\left( r_{i} \right)}{r_{i}}r_{i}\frac{\partial r_{i}}{\partial\theta_{k}^{d}}}}}} & (26) \\ {\frac{\partial r}{\partial\theta^{d}} = {{\frac{\partial f}{\partial\theta^{d}}\frac{\partial r}{\partial f}} = {\frac{\partial f}{\partial\theta^{d}}\left( {- {\nabla{I_{1}^{u}\left( {f(p)} \right)}}} \right)}}} & (27) \end{matrix}$

[0076] Jacobian matrix of the equation (18) is represented by equations (28) to (34) of [Equation 9].

[0077] Initial parameters c^(x), c_(y), k₂ and s_(x) for solving the equation (26) are set to ½ of width and height of I₂, 0 and 1, respectively. On the other hand, in all of equations (29) to (32), k₁ is arbitrarily initially set to avoid 0 by initial setting of k₁=k₂=0. Here, k₁ ∈ [−10⁻⁷, 10⁻⁷] is empirically selected.

Equation 9

[0078] $\begin{matrix} {\frac{\partial{f\left( p_{d} \right)}}{\partial\theta^{d}} = \begin{pmatrix} {R^{\prime 2}\frac{x_{d} - c_{r}}{s_{r}}} & {R^{\prime 2}\left( {y_{d} - c_{y}} \right)} \\ {R^{\prime 4}\frac{x_{d} - c_{r}}{s_{r}}} & {R^{\prime 4}\left( {y_{d} - c_{y}} \right)} \\ \frac{\partial x_{y}}{\partial c_{r}} & \frac{\partial y_{u}}{\partial c_{r}} \\ \frac{\partial x_{u}}{\partial c_{y}} & \frac{\partial y_{u}}{\partial c_{y}} \\ \frac{\partial x_{u}}{\partial s_{r}} & \frac{\partial y_{u}}{\partial s_{r}} \end{pmatrix}} & (28) \\ \begin{matrix} {\frac{\partial x_{u}}{\partial c_{x}} = \quad {1 - {\frac{1}{s_{x}}\left( {1 + {\kappa_{1}R^{\prime 2}} + {\kappa_{2}R^{\prime 4}}} \right)}}} \\ {\quad {{- 2}\left( {\kappa_{1} + {2\kappa_{2}R^{\prime 2}}} \right)\frac{\left( {x_{d} - c_{x}} \right)^{2}}{s_{x}^{3}}}} \end{matrix} & (29) \\ {\frac{\partial y_{u}}{\partial c_{x}} = {{- 2}\left( {\kappa_{1} + {2\kappa_{2}R^{\prime 2}}} \right)\frac{x_{d} - c_{x}}{s_{x}^{2}}\left( {y_{d} - c_{y}} \right)}} & (30) \\ {\frac{\partial x_{u}}{\partial c_{y}} = {{- 2}\left( {\kappa_{1} + {2\kappa_{2}R^{\prime 2}}} \right)\frac{x_{d} - c_{x}}{s_{x}}\left( {y_{d} - c_{y}} \right)}} & (31) \\ \begin{matrix} {\frac{\partial y_{u}}{\partial c_{y}} = \quad {1 - \left( {1 + {\kappa_{1}R^{\prime 2}} + {\kappa_{2}R^{\prime 4}}} \right)}} \\ {\quad {{- 2}\left( {y_{d} - c_{y}} \right)^{2}\left( {\kappa_{1} + {2\kappa_{2}R^{\prime 2}}} \right)}} \end{matrix} & (32) \\ \begin{matrix} {\frac{\partial x_{u}}{\partial s_{x}} = \quad {\frac{- \left( {x_{d} - c_{x}} \right)}{s_{x}^{2}}\left( {1 + {\kappa_{1}R^{\prime 2}} + {\kappa_{2}R^{\prime 4}}} \right)}} \\ {\quad {{- 2}\left( {\kappa_{1} + {2\kappa_{2}R^{\prime 2}}} \right)\frac{\left( {x_{d} - c_{x}} \right)^{3}}{s_{x}^{4}}}} \end{matrix} & (33) \\ {\frac{\partial y_{u}}{\partial s_{x}} = \quad {{- 2}\left( {y_{d} - c_{y}} \right)\left( {\kappa_{1} + {2\kappa_{2}R^{\prime 2}}} \right)\frac{\left( {x_{d} - c_{x}} \right)^{2}}{s_{x}^{3}}}} & (34) \end{matrix}$

Repetition of Two Steps

[0079]FIG. 5 is a schematic diagram showing a method of repeating two steps. Even when there is a relatively large residual in an initial state, a strategy for shifting to a fine resolution from a coarse resolution (coarse-to-fine) is employed in order to shorten a calculation time and perform precise estimation. That is, first a filtered and blurred image is processed, a filter is gradually changed to a filter having a smaller blur, and a cleared image is processed. Therefore, while the resolutions of I₁, I₁ ^(u), I₂ are changed to the fine resolution from the coarse resolution, second and third steps are alternately repeated (see FIG. 5).

[0080] Therefore, the estimation of the second step has to be corrected to include an estimated value θ^(d) of the third step.

[0081] Here, I₂ ^(f) is assumed to be an image obtained by correcting distortion of the photographed image I₂ through transformation f using the parameter θ^(d). That is, the image can be represented by equations (35), (36).

[0082] This is used to correct the equation (3) of the residual as represented by equation (37).

[0083] In this case, Jacobian equation (12) turns to equation (38).

[0084] The corrected second step, and the third step are alternately repeated until the estimated value converges.

[0085] The image having no distortion can be obtained from the photographed image by the transformation f using the parameter θ^(d) out of the obtained parameters.

Equation 10

I₂ ^(f)(f(p;θ^(d));θ^(d))=I₂(p)   (35)

I₂ ^(f)(p;θ^(d))=I₂(d(p;θ^(d)))   (36)

r _(i) =I ₁(p _(i))−I ₂ ^(f)(p _(i) +u(p _(i);θ^(u));θ^(d))   (37)

[0086] $\begin{matrix} {\frac{\partial r}{\partial\theta^{u}} = {{- M^{u\quad T}}{\nabla{I_{2}^{f}\left( {{p + {u\left( {p;\theta^{u}} \right)}};\theta^{d}} \right)}}}} & (38) \end{matrix}$

Estimation with One Step

[0087]FIG. 6 is a schematic diagram showing an estimating method with one step. The estimation by the repetition of two steps has been described above, but these two steps can be unified into one estimating step.

[0088] Since d is not the explicit function, that is, d is an implicit function unable to be represented by any equation, a function obtained by synthesizing u and d also becomes implicit function. This synthesized function u·d transforms the image I₁ to I₁ ^(ud). Therefore, the parameter θ^(u), θ^(d) may be obtained such that I^(ud) accurately equals with I₂. In this case, Jacobian of the synthesized function needs to be explicit, and the explicit function is obtained from Jacobian of u and d.

[0089] In actual, since d is an implicit function, Jacobian cannot be obtained by directly differentiating the equation. However, when the implicit function theorem known in a mathematical field is used, Jacobian of d can be obtained as the explicit function.

[0090] Here, it is assumed that p_(u) and θ^(d) are unified into one, and represented by q=(p_(u), θ^(d)) Then, function F of equation (39) as the function of q is considered.

[0091] In this case, d is an implicit function defined by p_(d)=d(q). Therefore, Jacobian of d can be calculated by the implicit function theorem as represented by equations (40) and (41).

[0092] Here, E₂ is a 2×2 unit matrix, and represented by equation (41a). Moreover, ∂f/∂θ^(d) is the same as the equation (28). Moreover, ∂f/∂p_(d) can be calculated from the equation (18), and is actually represented by equations (42) and (43) using the equations (29) to (32).

Equation 11

F(q,p _(d))=p _(u) −f(p _(d),θ^(d))=0  (39)

[0093] $\begin{matrix} {\frac{\partial d}{\partial q} = {{- \frac{\partial F^{- 1}}{\partial p_{d}}}\frac{\partial F}{\partial q}}} & (40) \\ {\quad {= {{- \frac{\partial f^{- 1}}{\partial p_{d}}}\left( {{- E_{2}}\frac{\partial f}{\partial\theta^{d}}} \right)}}} & (41) \\ {E_{2} = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}} & \left( \text{41a} \right) \\ {\frac{\partial f}{\partial p_{d}} = \begin{pmatrix} \frac{\partial x_{u}}{\partial x_{d}} & \frac{\partial y_{u}}{\partial x_{d}} \\ \frac{\partial x_{u}}{\partial y_{d}} & \frac{\partial y_{u}}{\partial y_{d}} \end{pmatrix}} & (42) \\ {= \begin{pmatrix} {1 - \frac{\partial x_{u}}{\partial c_{x}}} & {- \frac{\partial y_{u}}{\partial c_{x}}} \\ {- \frac{\partial x_{u}}{\partial c_{y}}} & {1 - \frac{\partial y_{u}}{\partial c_{y}}} \end{pmatrix}} & (43) \end{matrix}$

[0094] As described above, Jacobian of the function obtained by synthesizing transformations u, d can be calculated. A squared sum of luminance differences from the point in the photographed image I₂ corresponding to the point p_(i) in the pattern I₁, and is represented by equations (44), (45).

[0095] Parameter θ={θ^(u),θ^(d)} for minimizing the squared sum is estimated (see FIG. 6). The optimizing method for the estimation is performed similarly as the estimation of the second and third steps. That is, the simultaneous linear equation to be solved is represented by equation (46).

[0096] Here, partial differential ∂r_(i)/∂θ_(k) is derived as an element of Jacobian of equations (47) to (52).

[0097] Here, p_(d)=d(p_(u)), p_(u)=p+u (p) Moreover, E₅ is a 5×5 unit matrix.

[0098] The image having no distortion can be obtained from the photographed image by the transformation f using the parameter θ^(d) out of the obtained parameters.

Equation 12

r _(i) =I ₁(p _(i))−I ₂(d(p_(i) +u(p _(i),θ^(u))),θ^(d))   (44)

[0099] $\begin{matrix} {{\min\limits_{\theta^{u}}{\sum\limits_{i}{\rho \left( r_{i} \right)}}},{{\rho \left( r_{i} \right)} = r_{i}^{2}}} & (45) \\ {{\sum\limits_{l}{\sum\limits_{i}{\frac{\overset{.}{\rho}\left( r_{i} \right)}{r_{i}}\frac{\partial r_{i}}{\partial\theta_{k}}\frac{\partial r_{i}}{\partial\theta_{l}}{\delta\theta}_{l}}}} = {- {\sum\limits_{i}{\frac{\overset{.}{\rho}\left( r_{i} \right)}{r_{i}}r_{i}\frac{\partial r_{i}}{\partial\theta_{k}}}}}} & (46) \\ {\frac{\partial r}{\partial\theta} = {\frac{\partial r}{\partial q}\frac{\partial q}{\partial\theta}}} & (47) \\ {= {\frac{\partial r}{\partial d}\frac{\partial d}{\partial q}\left( {\frac{\partial q}{\partial\theta^{u}}\frac{\partial q}{\partial\theta^{d}}} \right)}} & (48) \\ {= {\frac{\partial r}{\partial d}\frac{\partial d}{\partial q}\begin{pmatrix} \frac{\partial p_{u}}{\partial\theta^{u}} & \frac{\partial p_{u}}{\partial\theta^{d}} \\ \frac{\partial\theta^{d}}{\partial\theta^{u}} & \frac{\partial\theta^{d}}{\partial\theta^{d}} \end{pmatrix}}} & (49) \\ {= {\frac{\partial r}{\partial d}\frac{\partial d}{\partial q}\begin{pmatrix} \frac{\partial p_{u}}{\partial\theta^{u}} & 0 \\ 0 & E_{5} \end{pmatrix}}} & (50) \\ {= {{- {\nabla\quad {I_{2}\left( {d\left( p_{u} \right)} \right)}}}\frac{\partial d}{\partial q}\begin{pmatrix} M^{u} & 0 \\ 0 & E_{5} \end{pmatrix}}} & (51) \\ {= {{\nabla\quad {I_{2}\left( {d\left( p_{u} \right)} \right)}}\frac{\partial f^{- 1}}{\partial p_{d}}\begin{pmatrix} {- M^{u}} & \frac{\partial f}{\partial\theta^{d}} \end{pmatrix}}} & (52) \end{matrix}$

Several Strategies

[0100] (1) Interpolation of Pixel Value

[0101] When the luminance of the point having no coordinate on an integer grid is necessary, bilinear interpolation is applied between adjacent pixel values.

[0102] (2) Histogram Matching

[0103] For the image taken by the camera, since pattern luminance often changes, image histogram is converted so that the histogram of the image becomes the same as that of the pattern.

EXAMPLES

[0104] While the camera zoom parameter was changed, an experiment was performed for the actual image taken by the camera in the proposed method. A picture shown in FIG. 2 was used as the calibration pattern printed by a laser printer (EPSON LP-9200PS2), and an image of the picture was taken by a CCD camera (Sony EVI-D30) fixed on a support with image taking software (SGI O2). While the camera zoom was changed from a widest angle, two images of grid and calibration patterns were photographed. The wider the angle is, the more the distortion influence increases. Then, a grid line is curved.

[0105] An estimation result of the internal parameter according to the present invention is shown in Table 1. Moreover, this internal parameter is used to show images before and after the correction in FIG. 3 and FIG. 4. It is seen that the curved line in the grid pattern is transformed into a straight line by the correction. TABLE 1 FIG. 3 (a) FIG. 3 (e) k₁ 2.804e-07 −6.7631e-08 k₂ 2.992e-13 5.219e-13 c_(x) 327.8 326.6 c_(y) 214.3 184.2 s_(x) 0.9954 0.9997

[0106] A gradation change of an image illuminance cannot be removed by a simple histogram conversion which is to be replaced with the estimation of the illuminance change by some methods such as linear luminance restriction. Therefore, the grid line is still slightly curved particularly in a peripheral portion of the image, and as shown on the right side of FIG. 3, there is a slight error in the experiment result.

[0107] In an experiment simulation in which a noise was added to each pixel of the transformed pattern and the pattern was used as the distorted image, the proposed method satisfactorily functioned even with a uniform amplitude of added noise of ±50 or more.

[0108] As described above, in the present invention, there is proposed an inventive method for obtaining the internal parameter of the camera to correct the image distortion. The proposed method is based on the image registration, and includes two nonlinear optimizing steps of perspective fitting and distortion fitting by geometric transformation. The experiment result has proved an efficiency of the present proposed method which can reduce an operator's labor. The nonlinear optimization requires time, but the technique is sufficiently effective as a batch process.

[0109] As described above, there is proposed an inventive image lens distortion correcting method for obtaining the camera internal parameter to correct the distortion of the image taken by the camera with the zoom lens attached thereto. This method is based on image registration. First, a certain calibration pattern is transformed into the distorted image pattern using affine transformation. Subsequently, the nonlinear optimization of Gauss-Newton method for minimizing the luminance difference of pixel values of two images is applied, and the two images are registered. Finally, the distortion parameter is estimated to minimize the luminance difference remaining after the second step. The experiment result shows effectiveness of the proposed method.

[0110] Therefore, in the image lens distortion correcting method of the present invention, (1) no correspondence point needs to be given, (2) any special tool or object is not used, and (3) all points on the image are used, so that the internal parameter can automatically be obtained with high precision, the image lens distortion can be corrected with high precision, and other superior effects are produced.

[0111] Additionally, the present invention is not limited to the aforementioned embodiment, and can of course variously be changed within the scope of the present invention. 

What is claimed is:
 1. An image lens distortion correcting method comprising: an image printing step (A) for printing an arbitrary image I₁ in a computer; an image pickup step (B) for photographing the printed image I₁ with a camera having a lens distortion and obtaining a photographed image I₂ in the computer; a parameter estimating step (C) for obtaining a parameter θ such that the image I₁ is artificially distorted with the parameter θ and an obtained distorted image I₁ ^(ud) equals with the photographed image I₂; and an image correcting step (D) for using the obtained parameter θ to correct the image photographed by the camera.
 2. The image lens distortion correcting method according to claim 1 wherein said parameter θ comprises a position correction parameter θ^(U) for correcting a position, and a distortion correction parameter θ^(d) for correcting the distortion.
 3. The image lens distortion correcting method according to claim 2 wherein said position correction parameter θ^(u) is a parameter for conversion to an image I₁ ^(u) with the corrected position from the image I₁, the conversion parameter is obtained in a least-squares method such that a difference r=I₁(p)−I₁ ^(u)(p+u) between a luminance value I₁ (p) of a point p in the image I₁ and a luminance value I₁ ^(u)(p+u) of a point p+u in the image I₁ ^(u) corresponding to the point p is minimized entirely on the image, and the obtained parameter is used as the position correction parameter θ^(u).
 4. The image lens distortion correcting method according to claim 3 wherein said distortion correction parameter θ^(d) is a parameter for conversion to the image I₁ ^(u) from the distorted image I₁ ^(ud), the conversion parameter is obtained in the least-squares method such that a difference r=I₂(p)−I₁ ^(u)(f(p)) between a luminance value I₂(p) of the point p in the image I₂ and a luminance value I₁ ^(u)(f(p)) of a point f(p) in the image I₁ ^(u) corresponding to the point p is minimized entirely on the image, and the obtained parameter is used as the distortion correction parameter θ^(d).
 5. The image lens distortion correcting method according to claim 4 wherein said parameter estimating step (C) comprises a step of alternately repeatedly using said position correction parameter θ^(u) and said distortion correction parameter θ^(d) to obtain the parameter θ.
 6. The image lens distortion correcting method according to claim 5 wherein said parameter θ is a parameter for conversion to the image I₁ ^(ud) from the image I₁, the conversion parameter is obtained in a least-squares method such that a difference r=I₁(p)−I₂(d(p+u(p)) between a luminance value I₁ (p) of a point p in the image I₁ and a luminance value I₂(d(p+u(p)) of a point d(p+u(p)) in the image I₂ corresponding to the point p is minimized entirely on the image, and the obtained parameter is used as the parameter θ.
 7. The image lens distortion correcting method according to claim 4 wherein said image correcting step (D) comprises a step of using the obtained distortion correction parameter θ^(d) to correct the image photographed by the camera. 